package app;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import util.file.LineReader;

public class App {
	
	String inputPath = "/home/cryptdb/temp/app.csv";
	
	public Map<String, List<String>> getApp() {
		String head;
		Map<String, List<String>> headMap = new HashMap<String, List<String>>();
		LineReader lineReader = new LineReader(inputPath);
		
		BufferedReader bufferedReader = lineReader.getBufferedReader();
		String line;
		String[] lineSplit;
		
		try {
			while ((line = bufferedReader.readLine()) != null) {
				List<String> headList = new ArrayList<String>();
				lineSplit = line.split(",");
				head = lineSplit[0];
				for (int i = 1; i < lineSplit.length; i ++) {
					headList.add(lineSplit[i]);
				}

				headMap.put(head, headList);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return headMap;
		
		
	}
	
	

}
